from django.conf import settings
from ronglian_sms_sdk import SmsSDK
import json

def send_message(tid,phone,datas):
    ronglianyun = settings.RONGLIANYUN
    sdk = SmsSDK(ronglianyun['accId'], ronglianyun['accToken'], ronglianyun['appId'])
    res = sdk.sendMessage(tid, phone, datas)
    response = json.loads(res)

    return response.get('statusCode') == '000000'

